package com.msb.c01;

import java.util.concurrent.TimeUnit;

/**
 * @author: xw
 * @create: 2022/9/21 11:07
 * @description: 什么是线程
 */
public class Code01_WhatIsThreads {

    private static class T1 extends Thread{
        @Override
        public void run(){
            for (int i = 0; i < 10; i++) {
                try {
                    TimeUnit.MILLISECONDS.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("T1");
            }
        }
    }

    public static void main(String[] args) {
        new T1().start();
        try {
            TimeUnit.MILLISECONDS.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("main");
    }
}
